"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Log = void 0;
var utils_1 = require("./utils");
var path_1 = __importDefault(require("path"));
var Log = /** @class */ (function () {
    function Log() {
    }
    // 错误
    Log.error = function (error) {
        // 当前时间
        var now = Date.now();
        // 错误信息
        var errLog = "\n" + now + "\n---------------------------------------------------------------\n\u9519\u8BEF\u65F6\u95F4: " + (0, utils_1.parseTime)(now) + "\n\n\u9519\u8BEF\u540D\u79F0: " + error.name + "\n\n\u9519\u8BEF\u4FE1\u606F: " + error.message + "\n\n\u9519\u8BEF\u5806\u6808: " + error.stack + "\n---------------------------------------------------------------    \n";
        (0, utils_1.writeAppendFile)(Log.LOG_PATH, Log.ERROR_LOG_FILENAME, errLog);
    };
    // 打印
    Log.print = function (val) {
        // 当前时间
        var now = Date.now();
        // 打印内容
        var printLog = "\n" + now + "\n---------------------------------------------------------------\n\u6253\u5370\u65F6\u95F4: " + (0, utils_1.parseTime)(now) + "\n\n\u6253\u5370\u5185\u5BB9: " + val.toString() + "\n---------------------------------------------------------------\n";
        (0, utils_1.writeAppendFile)(Log.LOG_PATH, Log.PRINT_LOG_FILENAME, printLog);
    };
    // 日志目录
    Log.LOG_PATH = path_1.default.resolve(__dirname, '../../../log');
    // 错误日志文件名
    Log.ERROR_LOG_FILENAME = 'error-log.log';
    // 打印日志文件名
    Log.PRINT_LOG_FILENAME = 'print-log.log';
    return Log;
}());
exports.Log = Log;
